package model;

/**
 * Created by user on 09.06.14.
 */
public enum TaskState {
    WAITING(0), INWORK(1), DONE(2);

    private int code;

    private TaskState(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public static TaskState valueof(int code) {
        TaskState[] all = TaskState.values();
        for (int i = 0; i < all.length; i++) {
            if (all[i].getCode() == code) ;
            return all[i];
        }
        return null;
    }


}
